import { Navigate } from "react-router-dom";
import About from "../pages/About";
import Home from "../pages/Home";
import Message from '../pages/Home/Message'
import News from '../pages/Home/News'
import Details from "../pages/Home/News/Details";

// 路由表
// eslint-disable-next-line import/no-anonymous-default-export
export default [
    {
        path: "/about",
        element: <About></About>
    },
    {
        path: "/home",
        element: <Home></Home>,
        children:[
            {
                path: "news",
                element: <News></News>,
                children: [
                    // sparams传参
                    // {
                    //     path: "details/:id/:title/:content",
                    //     element: <Details></Details>
                    // },
                    // search传参
                    // {
                    //     path: "details",
                    //     element: <Details></Details>
                    // },
                    // state传参
                    {
                        path: "details",
                        element: <Details></Details>
                    },
                ]
            },
            {
                path: "message",
                element: <Message></Message>
            }
        ]
    },
    {
        path: "/",
        element: <Navigate to="/about"></Navigate>
    }
]

